﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.AdminPageBase" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ali:Get ID="Order" Object="Order" InnerID="Request.QueryString['ID']" Validate="True" />
<ali:List ID="Unit" Object="Unit" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查看</title>
<ali:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<link rel="stylesheet" href="<%=CssPath%>host.css" />
<script language="c#" runat="server">
protected string GetUnitName(object unitID)
{
	if (Guid.Equals(unitID, Guid.Empty))
		return String.Empty;

	DataRow[] rows = Unit.Select(Alias.Unit.ID + "='" + unitID + "'");
	if (rows.Length == 0)
		return String.Empty;
	else
		return rows[0][Alias.Unit.Name].ToString();
}
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame_flipCHS.gif" alt="关闭侧栏导航" /></div>
	<div class="Title"><a href="../../IlgharCMS.HostModule/order/list.aspx">订单列表</a> → <%=Order[Number]%></div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left Selected"></li>
		<li class="Middle Selected">查看</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../../IlgharCMS.HostModule/order/feedback.aspx?ID=<%=Request.QueryString["ID"]%>">反馈</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<table border="0" cellpadding="4" cellspacing="1">
		<tbody>
			<tr>
				<th>订单号：</th>
				<td><%=Order[Number]%></td>
			</tr>
			<tr>
				<th>订单状态：</th>
				<td>
					<%If Convert.ToBoolean(Order[IsConfirmed])%>
						<%If Int32.Equals(Order[IsPayed], 1)%>
							未付款
						<%ElseIf Int32.Equals(Order[IsPayed], 2)%>
							部分付款
						<%ElseIf Int32.Equals(Order[IsPayed], 3)%>
							已付款
						<%ElseIf Int32.Equals(Order[IsPayed], 4)%>
							部分退款
						<%ElseIf Int32.Equals(Order[IsPayed], 5)%>
							已退款
						<%EndIf%>
						，
						<%If Int32.Equals(Order[IsDelivered], 1)%>
							未发货
						<%ElseIf Int32.Equals(Order[IsDelivered], 2)%>
							部分发货
						<%ElseIf Int32.Equals(Order[IsDelivered], 3)%>
							已发货
						<%ElseIf Int32.Equals(Order[IsDelivered], 4)%>
							部分退货
						<%ElseIf Int32.Equals(Order[IsDelivered], 5)%>
							已退货
						<%EndIf%>
					<%Else%>
						未受理
					<%EndIf%>
					
					<%If Convert.ToBoolean(Order[IsArchived])%>
						，已归档
					<%EndIf%>
					
					<%If Convert.ToBoolean(Order[IsCanceled])%>
						，已取消
					<%EndIf%>
				</td>
			</tr>
			<tr>
				<th>订单金额：</th>
				<td><%=Order[Sum]%></td>
			</tr>
			<tr>
				<th>已付金额：</th>
				<td><%=Order[HasPayed]%></td>
			</tr>
			<tr>
				<th>是否需要发票：</th>
				<td>
					<%If Convert.ToBoolean(Order[NeedInvoice])%>
						是
					<%Else%>
						否
					<%EndIf%>
				</td>
			</tr>
			<tr>
				<th>折扣或涨价：</th>
				<td><%=Order[PriceAdjustment]%></td>
			</tr>
			<tr>
				<th>备注：</th>
				<td><%=Order[Memo]%></td>
			</tr>
			<tr>
				<td colspan="2">
					<table id="DetailTable" border="0" cellpadding="4" cellspacing="1">
						<thead>
							<tr>
								<th style="width:120px">货号</th>
								<th>名称</th>
								<th style="width:60px">价格</th>
								<th style="width:60px">数量</th>
								<th style="width:60px">已发</th>
							</tr>
						</thead>
						<tbody>
							<ali:List Object="Order.Detail" Condition="OrderID=Order[ID] and ParentID IS NULL">
								<ali:Record>
									<tr>
										<td><%=ProductNumber%></td>
										<td style="text-align:left">
											<%=Name%>
											<%If Convert.ToBoolean(OnTrial)%>
												，试用中
											<%EndIf%>
											<%If !Convert.IsDBNull(ExpiredTime)%>
												，过期时间：<%=ExpiredTime%>
											<%EndIf%>
											<ali:List Object="Order.Detail" Condition="OrderID=Order[ID] and ParentID=ID">
												<ali:Record>
													<blockquote>
													+ <%=Name%> - <%=Amount%> <%=GetUnitName(UnitID)%>
													<%If Convert.ToBoolean(OnTrial)%>
														，试用中
													<%EndIf%>
													<%If !Convert.IsDBNull(ExpiredTime)%>
														，过期时间：<%=ExpiredTime%>
													<%EndIf%>													
													</blockquote>
												</ali:Record>
											</ali:List>
										</td>
										<td><%=Price%></td>
										<td><%=Amount%> <%=GetUnitName(UnitID)%></td>
										<td><%=DeliveredAmount%> <%=GetUnitName(UnitID)%></td>
									</tr>
								</ali:Record>
							</ali:List>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=JsPath%>common.js"></script>
<script type="text/javascript" src="<%=JsPath%>host.js"></script>
</body>
</html>